package com.guigu.pd.auth.service.impl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.common.utils.PageUtils;
import com.guigu.common.utils.Query;

import com.guigu.pd.auth.dao.SsqDao;
import com.guigu.pd.auth.entity.SsqEntity;
import com.guigu.pd.auth.service.SsqService;


@Service("ssqService")
public class SsqServiceImpl extends ServiceImpl<SsqDao, SsqEntity> implements SsqService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SsqEntity> page = this.page(
                new Query<SsqEntity>().getPage(params),
                new QueryWrapper<SsqEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SsqEntity> getallProvince(Integer pid) {
        QueryWrapper<SsqEntity> queryWrapper = new QueryWrapper<SsqEntity>();
        queryWrapper.eq("pid", pid);
        List<SsqEntity> chinaAddresses = this.list(queryWrapper);
        return chinaAddresses;
    }

}